#-*- coding:utf-8 -*-
from selenium import webdriver
import unittest
import  uniout


class login(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.driver.maximize_window()
        self.driver.get("https://passport.jd.com/new/login.aspx?ReturnUrl=https%3A%2F%2Fwww.jd.com%2F%3Fcu%3Dtrue%26utm_source%3Dbaidu-pinzhuan%26utm_medium%3Dcpc%26utm_campaign%3Dt_288551095_baidupinzhuan%26utm_term%3D0f3d30c8dba7459bb52f2eb5eba8ac7d_0_f96bb5f6af3a4b659b87e65dd4282e76")
        self.driver.implicitly_wait(10)

        self.login_tab_r =self.driver.find_element_by_class_name("login-tab-r")
        self.loginname= self.driver.find_element_by_id("loginname")
        self.nloginpwd=self.driver.find_element_by_id("nloginpwd")
        self.loginsubmit=self.driver.find_element_by_id("loginsubmit")

        self.login_box =self.driver.find_element_by_class_name("login-box")
        self.qrcode_ogin =self.driver.find_element_by_class_name("qrcode-login")



        pass
    def tearDown(self):
        self.driver.quit()

        pass
    def test_us_nome_ps_nome(self):
        u"""账号不为空，密码不为空，密码错误！！！"""
        self.login_tab_r.click()

        self.loginname.send_keys(u"会计师快递费")
        self.nloginpwd.send_keys("51624")

        self.loginsubmit.click()

        self.driver.implicitly_wait(5)

        self.msg=self.driver.find_element_by_class_name("msg-error")
        self.text=self.msg.text

        self.assertAlmostEqual(self.text,u"请将账号..............................")
    def test_us_nome_ps_em(self):
        u"""空！！！"""
        pass







